//
//  ZYAssignmentCell.m
//  HTW
//
//  Created by Ethan on 2017/9/22.
//  Copyright © 2017年 乾坤. All rights reserved.
//

#import "ZYAssignmentCell.h"

@implementation ZYAssignmentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    
    return self;
    
}


- (void)setUpSuperView{
    
    self.nameLabel = [UILabel new];
    [self.contentView addSubview:self.nameLabel];

    self.addButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.contentView addSubview:self.addButton];
    
    
    self.nameLabel.text = @"数学课";

    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(8);
        make.top.offset(8);
        make.right.equalTo(self.contentView).offset(-80);
        
    }];
    
    
    
    
    [self.addButton setTitle:@"添加" forState:(UIControlStateNormal)];
    [self.addButton setTitleColor:[UIColor purpleColor] forState:(UIControlStateNormal)];
    [self.addButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-8);
        make.top.centerY.equalTo(self.nameLabel);
        make.width.offset(60);
    }];
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(self.addButton).offset(5);
    }];
    
    
    
}








@end
